<!DOCTYPE html>
{assign name="pn" value="search"}
<html>
<head>
    <meta charset="UTF-8" />
    <!--<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-comp|ie-stand" />
    <title>酷代码-专业的源代码分享网站</title>
    <meta name="baidu-site-verification" content="code-xEvBW4PmsD" />
    <meta name="keywords" content="{:keywords}" />
    <meta name="description" content="酷代码,专业的源代码分享网站,聚合高质量的java/jquery/bootstrap/html/css/php/python源代码" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <script src="{:jquery}"></script>
    <link href="{:bootstrap_min_css}" rel="stylesheet">
    <script src="{:bootstrap_min_js}"></script>
    <link rel="stylesheet" href="/min/?g=css&v={:version}">
    <style>

    </style>
</head>
<body class="b20">

{include file="inc/header" /}
{assign name="keyword" value="$rets.key"}
<div class="container">

    <div class="row">
        <div class="col-md-9 ecol">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        <span>搜索:</span>
                        <span class="flmc">{$keyword}</span>
                        <span>共{$rets.total}条结果</span>
                    </h3>

                </div>
                <div class="panel-body">

                    <div>
                        {volist name='rets.list' id='vo'}
                        <div class="project">
                            <div class="box1">
                                <a href="/user/{$vo.user.id}.html">
                                    <img src="{$vo.user.avatar}" alt="">
                                </a>
                            </div>
                            <div class="box2">
                                <div>
                                    <a class="username" href="">{$vo.user.nickname}</a>
                                    <span class="created">{$vo.create_time|datestr='Y-m-d H:i'}</span>
                                </div>
                                <a class="title" href="/share/{$vo.id}.html">{$vo.name}</a>
                                <div class="intro">
                                    {$vo.content|html_entity_decode|strip_tags|lcTrim|msubstr=0,200}
                                </div>
                                <div class="yltu">
                                    {volist name="vo.imgs" id="k" offset="0" length="3"}
                                    <img src="{$k}" alt="">
                                    {/volist}
                                </div>
                                <div class="opts">
                                    <span class="word">浏览{$vo.view_}</span>
                                    <span class="word">下载{$vo.down_}</span>
                                    <!--<span class="word">评论0</span>-->
                                    <span class="word">硬币{$vo.price}</span>
                                    {//项目的标签}
                                    <div class="tags-wrapper">
                                    {volist name="vo.tags" id="t" }
                                    <a class="tags" href="">{$t.name}</a>
                                    {/volist}
                                    </div>
                                    <a href="/code/{$vo.category.code}.html"><span class="layui-badge topic">{$vo.category.name}</span></a>
                                </div>
                            </div>
                        </div>
                        {/volist}

                    </div>
                    <div style="text-align: center">
                        <nav aria-label="Page navigation">
                            <ul class="pagination">

                                <li>
                                    <a href="?page={$rets.prev}&key={$keyword}" aria-label="上一页">
                                        <span aria-hidden="true">上一页</span>
                                    </a>
                                </li>


                                {assign name="p" value="$rets" /}
                                {assign name="c" value="$rets.curr" /}
                                {assign name="t" value="5" /*当前页左右的按钮数*/ }
                                {assign name="m" value="$t+3" /*基准线1*/ /}
                                {assign name="n" value="$p.pages-$t-2" /*基准线2*/ /}


                                {for start="1" end="$p.pages+1"}
                                {assign name="ok" value="0"}
                                {if ($i==1) or ($i==$p.pages) or ($i>=$c-$t and $i<=$c+$t) or ($c<=$m and $i<=$m+$t) or ($c>=$n and $i>=$n-$t) or ($m>=$n and ($i<=$m or $i>=$n)) }
                                {assign name="ok" value="1"}
                                {/if}
                                {if $ok==1 }
                                <li class="{$rets.curr==$i?'active':''}"><a href="?page={$i}&key={$keyword}">{$i}</a></li>
                                {/if}
                                {if ($i==2 and $ok==0) or ($i==$p.pages-1 and $ok==0)}
                                <li class="disabled"><a href="javascript:void(0)">...</a></li>
                                {/if}
                                {/for}


                                <li>
                                    <a href="?page={$rets.next}&key={$keyword}" aria-label="下一页">
                                        <span aria-hidden="true">下一页</span>
                                    </a>
                                </li>


                            </ul>
                        </nav>
                    </div>

                </div>

            </div>
        </div>
        <div class="col-md-3 ecol">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">语言分类</h3>
                </div>
                <div class="panel-body">
                    <div><a href="/code.html">全部</a></div>
                    {volist name="langs" id="c" }
                    <div><a href="/code/{$c.code}.html">{$c.name}</a></div>
                    {/volist}
                </div>
            </div>
            <!--<div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">Panel title</h3>
                </div>
                <div class="panel-body">
                    Panel content
                </div>
            </div>-->
        </div>
    </div>
</div>

{include file="inc/footer" /}
</body>
</html>
